package net.zoneland.zrdp.system.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import net.zoneland.zrdp.common.utils.DateUtil;
import net.zoneland.zrdp.system.domain.SysNoticeComment;
import net.zoneland.zrdp.system.mapper.SysNoticeCommentMapper;
import net.zoneland.zrdp.system.service.ISysNoticeCommentService;

import javax.annotation.Resource;

/**
 * 公告评论Service业务层处理
 *
 * @author zonevue
 */
@Service
public class SysNoticeCommentServiceImpl implements ISysNoticeCommentService {
    @Resource
    private SysNoticeCommentMapper sysNoticeCommentMapper;

    /**
     * 查询公告评论
     *
     * @param id 公告评论主键
     * @return 公告评论
     */
    @Override
    public SysNoticeComment selectSysNoticeCommentById(final Long id) {
        return sysNoticeCommentMapper.selectSysNoticeCommentById(id);
    }

    /**
     * 查询公告评论列表
     *
     * @param sysNoticeComment 公告评论
     * @return 公告评论
     */
    @Override
    public List<SysNoticeComment> selectSysNoticeCommentList(final SysNoticeComment sysNoticeComment) {
        return sysNoticeCommentMapper.selectSysNoticeCommentList(sysNoticeComment);
    }

    /**
     * 新增公告评论
     *
     * @param sysNoticeComment 公告评论
     * @return 结果
     */
    @Override
    public int insertSysNoticeComment(final SysNoticeComment sysNoticeComment) {
        sysNoticeComment.setCreateTime(DateUtil.getNowLocalDateTime());
        return sysNoticeCommentMapper.insertSysNoticeComment(sysNoticeComment);
    }

    /**
     * 修改公告评论
     *
     * @param sysNoticeComment 公告评论
     * @return 结果
     */
    @Override
    public int updateSysNoticeComment(final SysNoticeComment sysNoticeComment) {
        sysNoticeComment.setUpdateTime(DateUtil.getNowLocalDateTime());
        return sysNoticeCommentMapper.updateSysNoticeComment(sysNoticeComment);
    }

    /**
     * 批量删除公告评论
     *
     * @param ids 需要删除的公告评论主键
     * @return 结果
     */
    @Override
    public int deleteSysNoticeCommentByIds(final Long[] ids) {
        return sysNoticeCommentMapper.deleteSysNoticeCommentByIds(ids);
    }

    /**
     * 删除公告评论信息
     *
     * @param id 公告评论主键
     * @return 结果
     */
    @Override
    public int deleteSysNoticeCommentById(final Long id)
    {
        return sysNoticeCommentMapper.deleteSysNoticeCommentById(id);
    }
}
